package gphoto.vo;

import gphoto.util.GPhotoUtil;

import java.io.File;

public class PhotoEchantillon {
	
	private String nom;
	
	private File file;
	
	private boolean paysage;
	
	public PhotoEchantillon(File f) {
		file = f;
	}
	
	public PhotoEchantillon(String path) {
		file = new File(path);
	}

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	/**
	 * Retourne l'url de la vignette de la photo.
	 * e:\toto\titi.jpg --> http://localhost:8080/gPhoto/img/e/toto/_v/v_titi.jpg
	 */
	public String getURL() {

		return GPhotoUtil.getURL(file.getPath());
	}

	public boolean isPaysage() {
		return paysage;
	}

	public void setPaysage(boolean paysage) {
		this.paysage = paysage;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}
}
